package com.howells.time.module.discovery.view;

import android.content.Context;
import android.widget.ImageView;

import com.howells.time.R;
import com.howells.time.base.utils.ImageCacheUtils;
import com.howells.time.module.discovery.model.DiscoveryMode;
import com.zhy.base.adapter.ViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2016.5.11.
 */
public class DiscoveryAdapter extends com.zhy.base.adapter.recyclerview.CommonAdapter {

    public DiscoveryAdapter(Context context, int layoutId, List datas) {
        super(context, layoutId, datas);
    }

    @Override
    public void convert(ViewHolder holder, Object o) {
        DiscoveryMode m= (DiscoveryMode) o;
        holder.setImageBitmap(R.id.discovery_image,m.getImageView());
        holder.setTag(R.id.discovery_image,m.getUrl());
//        Log.d("DiscoveryAdapter", m.getUrl());
        ImageCacheUtils.setImageById(m.getUrl(),(ImageView) holder.getView(R.id.discovery_image));
    }
}
